Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Smarty add two 0 after ",'

I have my variable

{assign var='reduc' value=$valueprice}
{assign var='prix' value='30,00'}

I did that

{$prix - ($prix * $reduc)}

But i want the result to be displayed with two number after the "," at the end always ! like if the result is :

30 => 30,00 
24,5 => 24,50

I already tried with |string_format:"%.2f" it is not working

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Using float variables for money values is not good, see for example http://floating-point-gui.de/basic/

So if you are using integer values instead you could do something like:

{$dollar},{$cent|string_format:"%02d"}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!